<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>公务员平时考核管理系统</title>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi"/>
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
	<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">

    <link rel="shortcut icon" href="favicon.ico" type="image/x-icon"/>
    <link rel="stylesheet" href="static/css/font.css">
    <link rel="stylesheet" href="static/css/xadmin.css">
    <link rel="stylesheet" href="static/css/bootstrap.css">
    <link rel="stylesheet" href="static/css/basic.css">
        <link rel="stylesheet" href="static/css/login.css">
    <script type="text/javascript" src="static/js/jquery-3.3.1.js"></script>
    <script type="text/javascript" src="static/lib/layui/layui.js"></script>
    <script type="text/javascript" src="static/js/xadmin.js"></script>
	
	<script type="text/javascript" src="static/js/basic.js"></script>
	<script type="text/javascript" src="static/js/three.js"></script>



</head>
  <body>
    	<div class="pagewrap">
    		<div class="main" id="screen">
    			<div class="login-page dsj-login">
    				<div class="login-block">
    					<div class="login-pop">
    						<div class="login-body clearfix">
    							<div class="login-info">
    								<div class="form-list">
    									<div class="li">
    										<div class="ele-wrap">
    											<input type="text" id="username" class="form-control" placeholder="请输入工号">
    										</div>
    									</div>
    									<div class="li">
    										<div class="ele-wrap">
    											<input type="password" id="password" class="form-control" placeholder="请输入密码">
												<img id="passwordEyes" class="passwordEyes" src="static/img/eyes_on.png">
    										</div>
    									</div>
    									<div class="li">
                                            <div class="ele-wrap">
                                                <div class="code-img">
                                                <a href="javascript:void(0);" onclick="VerificationCode();">
                                                     <img id="captchaImage" src="changeCode.do" style="height: 48px;width: 120px;"/>
                                                </a>
                                                </div>
                                                <div class="proving-code">
                                                    <input id="identifyingcode" class="form-control" name="identifyingcode" placeholder="验证码" type="text" >
                                                </div>
                                            </div>
                                        </div>
    									<div class="li">
    										<div class="ele-wrap">
							                    <a class="btn btn-blue" id="emp-login-btn" href="javascript:;">登 录</a>
    										</div>
    									</div>
    								</div>
    							</div>
    						</div>
    					</div>
    				</div>
    			</div>
    		</div>
    	</div>
    </body>
    <script>
	$(function () {
		var winH = $(window).height();
		var starH = winH+50;
		var starW = 998/998*starH;
		$('.ico-star1').css({
			'height':starH+'px',
			'width': starW+'px'
		});
	});
</script>
</html>

<style>
	input[type="password"]::-ms-reveal {
		display: none;
	}

	.passwordEyes {
		position: absolute;
		right: 10px;
		top: 15px;

		width: 20px;
		cursor: pointer;
	}
</style>

<script type="text/javascript">
	document.writeln("<div class=\"snow\" style=\"height:1200px;position:fixed; left:0px; top:0px; right:0px; bottom:0px; pointer-events: none;z-index: 9999;\"><canvas width=\"1904\" height=\"913\" style=\"position: absolute;left: 0;top: 0;\"></canvas></div>");
	 // 更换验证码
    function VerificationCode() {
        $("#captchaImage").attr("src", "changeCode.do?timestamp=" + (new Date()).valueOf());
    }
    $("#emp-login-btn").click(function(){
    	var username = $("#username").val();
        var password = $("#password").val();
        var identifyingcode = $("#identifyingcode").val()

        if (username == ""){
            layer.msg("工号不能为空", {time: 2000, icon:5,anim: 6})
            $("#username").face()
            return false;
        }
        if (password == ""){
            layer.msg("密码不能为空", {time: 2000, icon:5,anim: 6})
            $("#password").face()
            return false;
        }
        if (identifyingcode == ""){
            layer.msg("验证码不能为空", {time: 2000, icon:5,anim: 6})
            $("#identifyingcode").face()
            return false;
        }

        //这是使用ajax的方式提交
        $.ajax({
            type: 'post',
            url: 'employeeLogin.do',
            data: {
                'username': username,
                'password': password,
                'identifyingcode': identifyingcode,
            },
            dataType: 'json',
            success: function (result) {
            	if(result.code==100){
            		 // layer.msg("登陆成功，正在跳转……")
                    window.location.href ="loginSuccess.do";
            	}else{
            		layer.msg(result.message);
            		layui.use(VerificationCode());
            	}
            }
        });
    })

	$("#passwordEyes").click(function () {
		if ($("#passwordEyes").attr("src") === "static/img/eyes_on.png") {
			$("#passwordEyes").attr("src","static/img/eyes_off.png");
			$("#password").attr("type", "text");
		} else {
			$("#passwordEyes").attr("src","static/img/eyes_on.png");
			$("#password").attr("type", "password");
		}
	})
$(function() {
	 
	
	
	
	if (/MSIE 6|MSIE 7|MSIE 8/.test(navigator.userAgent)) {
		return
	}
	var container = document.querySelector(".snow");
	// IE9-10 pointer-events兼容
	if (/MSIE 9|MSIE 10/.test(navigator.userAgent)) {
		$(container).bind('click mousemove', function(evt) {
			this.style.display = 'none';
			var x = evt.pageX, y = evt.pageY
			if ($(document).scrollTop() > 0 || $(document).scrollTop() > 0) {
				x = x - $(document).scrollLeft() + 1
				y = y - $(document).scrollTop() + 1
			}
			evt.preventDefault();
			evt.stopPropagation();
			var under = document.elementFromPoint(x, y);
			var evtType = evt.type === 'click' ? 'click' : 'mouseenter'
			if (evt.type === 'click') {
				$(under)[0].click();
			} else {
				$(under).trigger('mouseenter');
			}
			$('body').css('cursor', 'default')
			this.style.display = '';
			return false;
		});
	}
	var containerWidth = $(container).width();
	var containerHeight = $(container).height();
	var particle;
	var camera;
	var scene;
	var renderer;
	var mouseX = 0;
	var mouseY = 0;
	var windowHalfX = window.innerWidth / 2;
	var windowHalfY = window.innerHeight / 2;
	var particles = [];
	var particleImages = [new Image(),new Image(),new Image(),new Image(),new Image()];
	particleImages[0].src = "img/dsj_login/01.png";
	particleImages[1].src = "img/dsj_login/02.png";
	particleImages[2].src = "img/dsj_login/03.png";
	particleImages[3].src = "img/dsj_login/04.png";
	var snowNum = 300;
	function init() {
		camera = new THREE.PerspectiveCamera(75, containerWidth / containerHeight, 1, 10000);
		camera.position.z = 1000;
		scene = new THREE.Scene();
		scene.add(camera);
		renderer = new THREE.CanvasRenderer();
		renderer.setSize(containerWidth, containerHeight);
		for (var i = 0; i < snowNum; i++) {
			var material = new THREE.ParticleBasicMaterial({ map: new THREE.Texture(particleImages[i % 5]) });
			particle = new Particle3D(material);
			particle.position.x = Math.random() * 2000 - 1000;
			particle.position.y = Math.random() * 2000 - 1000;
			particle.position.z = Math.random() * 2000 - 1000;
			particle.scale.x = particle.scale.y = 1;
			scene.add(particle);
			particles.push(particle)
		}
		container.appendChild(renderer.domElement);
		document.addEventListener("mousemove", onDocumentMouseMove, false);
		document.addEventListener("touchstart", onDocumentTouchStart, false);
		document.addEventListener("touchmove", onDocumentTouchMove, false);
		setInterval(loop, 1000 / 50)
	}
	function onDocumentMouseMove(event) {
		mouseX = event.clientX - windowHalfX;
		mouseY = event.clientY - windowHalfY;
	}
	function onDocumentTouchStart(event) {
		if (event.touches.length === 1) {
			event.preventDefault();
			mouseX = event.touches[0].pageX - windowHalfX;
			mouseY = event.touches[0].pageY - windowHalfY;
		}
	}
	function onDocumentTouchMove(event) {
		if (event.touches.length === 1) {
			event.preventDefault();
			mouseX = event.touches[0].pageX - windowHalfX;
			mouseY = event.touches[0].pageY - windowHalfY;
		}
	}
	function loop() {
		for (var i = 0; i < particles.length; i++) {
			var particle = particles[i];
			// 滚动到楼层模块，减少雪花 （自定义）
			if ($(window).scrollTop() < 1000) {
				particle.scale.x = particle.scale.y = 1;
			} else {
				if (i > particles.length / 5 * 3) {
					particle.scale.x = particle.scale.y = 0;
				} else {
					particle.scale.x = particle.scale.y = 0.8;
				}
			}
			particle.updatePhysics();
			with(particle.position) {
				if (y < -1000) {
					y += 2000
				}
				if (x > 1000) {
					x -= 2000
				} else {
					if (x < -1000) {
						x += 2000
					}
				}
				if (z > 1000) {
					z -= 2000
				} else {
					if (z < -1000) {
						z += 2000
					}
				}
			}
		}
		camera.position.x += (mouseX - camera.position.x) * 0.005;
		camera.position.y += (-mouseY - camera.position.y) * 0.005;
		camera.lookAt(scene.position);
		renderer.render(scene, camera)
	}
	init();
});
</script>
